package edu.zut.hb.software.knowledge.service.impl;

import edu.zut.hb.software.admin.domain.User;
import edu.zut.hb.software.base.service.impl.GenericManagerImpl;
import edu.zut.hb.software.knowledge.dao.KnowledgeDao;
import edu.zut.hb.software.knowledge.domain.Knowledge;
import edu.zut.hb.software.knowledge.service.KnowledgeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;


@Service
@Transactional
public class KnowledgeServiceImpl extends GenericManagerImpl<Knowledge,Long> implements KnowledgeService {

    KnowledgeDao knowledgeDao;

    @Autowired
    public void setKnowledgeDao(KnowledgeDao knowledgeDao) {
        this.knowledgeDao = knowledgeDao;
        this.dao=this.knowledgeDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            Knowledge Knowledge = new Knowledge();
            Knowledge.setName("第"+i+"信息");
            Knowledge.setNum(i);
            Knowledge.setStatus(true);
            list.add(Knowledge);
        }
        return list;
    }
}
